extends Node2D
var param = 0
var buffers = [
	#{"buffer_name":"减速","speed":1 + (-0.5),"rounds_number":3},
	{"buffer_name":"冻伤","magic_damage":40,"rounds_number":3}
]
var speed = 100
func _ready():
	#var buffer = {"buffer_name":"减速","speed":func(_val,_method):
		#if _method == "set":
			#return _val * (1 + (-0.5))
		#else:
			#return _val / (1 + (-0.5))
		#,"rounds_number":3}
	#print(speed)
	#apply_buffer(buffer)
	#print(speed)
	#remove_buffer(buffer)
	#print(speed)
	#var name1 = "bing_feng_ling_yu"
	#var c1 = Utils.instatiate_skill_class(name1)
	#print(c1)
	var array = [1,2]
	var a = "hello ssdf %s %%"
	"30334282","23000002",
	print(a % array.slice(1))

func apply_buffer(_buffer:Dictionary):
	buffers.append(_buffer)
	for key in _buffer.keys():
		if ["speed","attack_power","magic_power","max_health","max_mana"].has(key):
			#set(key,get(key)*_buffer[key])
			set(key,_buffer[key].call(speed,"set"))

func remove_buffer(_buffer:Dictionary):
	buffers.erase(_buffer)
	for key in _buffer.keys():
		if ["speed","attack_power","magic_power","max_health","max_mana"].has(key):
			#set(key,get(key)/_buffer[key])
			set(key,_buffer[key].call(speed,"restore"))
